home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d919.lha / BBBF / FileVirLib / ShowVirusList.S < prev    next >
Text File  |  1993-10-04  |  3KB  |  138 lines

  1. ;----------------------------------------------------------
  2. ;    Test of my removelink.library (ver 32.020)
  3. ;    Shows the viruses the current version of
  4. ;    removelink.library can handle...
  5. ;    ps.
  6. ;
  7. ;    This field (VirusList struct) is changed to,
  8. ;    APTR    VL_VirusName1
  9. ;    APTR    VL_VirusName2
  10. ;    APTR    VL_VirusName3
  11. ;    etc.
  12. ;    ULONG    NULL    <= End of struct
  13. ;
  14. ;                /Johan
  15. ;----------------------------------------------------------
  16.  
  17.     
  18.     incdir    df0:include/
  19.     include    exec/exec_lib.i        ;Normal includes
  20.     include    exec/libraries.i    ;Normal includes
  21.     include    exec/memory.i        ;Normal includes
  22.     include    libraries/dos_lib.i    ;Normal includes
  23.     include    libraries/dos.i        ;Normal includes
  24.  
  25.     incdir    df0:include/
  26.     include    RLL/removelink.i
  27.     include    RLL/removelink_lib.i
  28.  
  29. CALL    Macro
  30.     jsr    _LVO\1(a6)
  31.     endm
  32.  
  33. s:    move.l    4.w,a6
  34.     moveq.l    #32,d0
  35.     lea.l    RLLib(pc),a1
  36.     CALL    OpenLibrary
  37.     move.l    d0,RLBase
  38.     beq.b    .RLError
  39.  
  40.     lea.l    DosLib(pc),a1
  41.     CALL    OldOpenLibrary
  42.     move.l    d0,DosBase
  43.     beq.b    .DosError
  44.  
  45.     move.l    RLBase(pc),a6
  46.     CALL    AllocRLMem
  47.                 ;Now we want to have the initiaized
  48.                 ;buffer memory (with the virus-namelist)
  49.     tst.l    d0
  50.     beq.b    .RLError
  51.     move.l    d0,MemTable
  52.  
  53.     move.l    MemTable(pc),a0
  54.     move.w    RL_VirusesCovered(a0),-(sp)
  55.     move.l    RLBase(pc),a6
  56.     move.w    LIB_ReVision(a6),-(sp)
  57.     move.w    LIB_Version(a6),-(sp)
  58.     pea.l    Start(pc)
  59.     bsr.b    printf
  60.     lea.l    10(Sp),Sp
  61.  
  62.     move.l    RLBase(pc),a6
  63.     move.l    MemTable(pc),a0
  64.     beq.b    .RLError
  65.     move.l    RL_VirusList(a0),a0
  66.  
  67. .Again:    move.l    VL_VirusName(a0),-(sp)
  68.     pea.l    VirusName(pc)
  69.     bsr.b    PrintF
  70.     addq.l    #8,Sp
  71.     lea.l    VL_NextVirusName(a0),a0
  72.     tst.l    (a0)
  73.     bne.b    .Again
  74.  
  75. .Free:    move.l    MemTable(pc),a0
  76.     CALL    FreeRLMem
  77.  
  78.     ;Close RemoveLink library
  79.  
  80. .RLError:
  81.     move.l    RLBase(pc),a1
  82.     beq.b    .NotLoaded
  83.     move.l    4.w,a6
  84.     CALL    CloseLibrary
  85. .NotLoaded:
  86. .DosError:
  87.     move.l    DosBase(pc),a1
  88.     beq.b    .Rts
  89.     move.l    4.w,a6
  90.     CALL    CloseLibrary
  91. .Rts:    rts
  92.  
  93.     ;Quit
  94.     
  95.  
  96. printF:
  97.     movem.l    d0-a6,-(Sp)
  98.     move.l    4.w,a6
  99.     move.l    15*4+4*1(Sp),a0
  100.     lea.l    15*4+4*2(Sp),a1    
  101.     lea.l    .SubPrintF(pc),a2
  102.     link    a5,#-512
  103.     move.l    a5,a3
  104.     lea.l    -512(a3),a3
  105.     CALL    RawDoFMT
  106.     movem.l    d0-a6,-(sp)
  107.     lea.l    -512(a5),a5
  108.     move.l    DosBase(pc),a6
  109.     jsr    -60(a6)
  110.     move.l    d0,d1
  111.     move.l    a5,d2
  112. .1:    tst.b    (a5)+
  113.     bne.b    .1
  114.     move.l    a5,d3
  115.     sub.l    d2,d3
  116.     jsr    -48(a6)
  117.     movem.l    (Sp)+,d0-a6
  118.  
  119.     unlk    a5
  120.     movem.l    (Sp)+,d0-a6
  121.     rts
  122.  
  123. .SubPrintF:
  124.     move.b    d0,(a3)+
  125.     rts
  126.  
  127. RLLib:        dc.b    'removelink.library',0
  128. DosLib:        dc.b    'dos.library',0
  129. Start:        dc.b    'Viruses the ''removelink.library'' version '
  130.         dc.b    '%d.%d can remove:',10
  131.         dc.b    '(Totally a number of %d viruses)',10,0
  132. VirusName:    dc.b    '%30s ',10,0
  133.         even
  134.  
  135. RLBase:        dc.l    0
  136. MemTable:    dc.l    0
  137. DosBase:    dc.l    0
  138.